function avg_acc = test_gogo_norm(X1train, X2train, ytrain, ...
                                  gidtrain, norm_type)
% TEST_GOGO_NORM - calculates 3-fold avg accuracy for the 3 train groups.
    avg_acc = 0;
    for gid=1:3
        % generate test data
        [tr_data, tr_label, te_data, te_label] =  gen_splitted_data(X1train, ...
                                                                    X2train, ...
                                                                    ytrain, ...
                                                                    gidtrain, ...
                                                                    gid, ...
                                                                    norm_type);
        % normalize the data to [-1,1]. Test is normalized according to
        % train data.
        [tr_data, norm_params] = norm_data(tr_data);
        [te_data, ~] = norm_data(te_data, norm_params);

        acc = run_svm(tr_data, tr_label, te_data, te_label, 100, 0.1);
        avg_acc = avg_acc + acc;
    end
    avg_acc = avg_acc/3;
    fprintf('Accuracy achieved is %f\n', avg_acc);
end

